package com.udata.server.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.udata.shared.model.UserB;

@PersistenceCapable
public class User {

	public User() {

	}

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private String id = null;
	@Persistent
	private String name = null;
	@Persistent
	private String password = null;
	@Persistent
	private String email = null;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public UserB getBean() {
		UserB userB = new UserB();
		userB.setId(id);
		userB.setName(name);
		userB.setPassword(password);
		userB.setEmail(email);
		return userB;
	}

	public User(UserB userB) {
		this.id = userB.getId();
		this.name = userB.getName();
		this.password = userB.getPassword();
		this.email = userB.getEmail();
	}

}
